import urllib.request

def show_progress(block_num, block_size, total_size):
    downloaded = block_num * block_size
    percent = downloaded / total_size * 100
    print(f"\rDownloading: {percent:.2f}%", end="")

url = "https://ossci-datasets.s3.amazonaws.com/mnist/train-images-idx3-ubyte.gz"
urllib.request.urlretrieve(url, "train-images.gz", reporthook=show_progress)
print("\nDownload complete!")
